
public class semesterAmoedB2011question1 {
	
	public static void main (String[] args){
		
		int[] a = {3,1,2,1};
		int[] b = {3};
		int[] c = {2,2,2};
		int[] d = { };
		
			
		System.out.println(arrayGT(a,b)+" Should be false" );
		System.out.println(arrayGT(c,a)+" Should be false");
		System.out.println(arrayGT(a,c)+" Should be true" );
		System.out.println(arrayGT(c,b)+" Should be false");
		System.out.println(arrayGT(a,d)+" Should be true");
		System.out.println(arrayGT(c,d)+" Should be true");
		System.out.println(arrayGT(b,a)+" Should be false");
		System.out.println(arrayGT(d,a)+" Should be false");
		System.out.println(arrayGT(b,c)+" Should be true" );
		System.out.println(arrayGT(d,b)+" Should be false");
		System.out.println(arrayGT(b,d)+" Should be true" );
		System.out.println(arrayGT(d,c)+" Should be false");
		
	}
	
	public static boolean arrayGT(int[] x, int[] y){
		boolean answer;
		answer = false;
		int biggestValueY = 0;
		int biggestValueX = 0 ;
			
			if (x.length > 0){
			
				for (int i = 0 ; i < y.length ; i ++ ){
					if (biggestValueY < y[i]){
						biggestValueY = y[i];
					}
				}
				for (int i = 0 ; i < x.length ; i ++ ){
					if (biggestValueX < x[i]){
						biggestValueX = x[i];
					}
				}
				
				answer = biggestValueX > biggestValueY;
				
			}
			
		return answer;
		}

}
